#ifndef __CMAP_H__
#define __CMAP_H__

#include "Sprite.h"
#include "DxGraphics.h"
#include "DxInput.h"
#include "GameState.h"
#include "CScreen.h"
//Cac doi tuong game
#include "CWeapon.h"
//Game background
#include "QuadTree.h"
#include "CBackGround.h"
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <time.h>
#include <io.h>
#include <fstream>
#include <string>
#include <vector>

using std::vector;
using namespace	std;

class CMap
{
private:
	int _mapWidth;//Chieu rong
	int _mapHeight;//Chieu Cao
	CSound* _soundMangager;
	bool _isGameOver;
	int _world;
public:
	bool _loadGame;
	//2 Cay tu phan
	QuadTree* _quadTree;
	QuadTree* _quadTreeSight;
	//Man hinh game
	CScreen* _myScreen;
	//Nhan vat chinh
	//Doi tuong infor de ve cacs thong so

	//Doi tuong quan lys sung dan
	CMap(CSound *sManager,int idWord);
	~CMap();
	vector<string> SplitString(string str,char ch);
	int GetWorld(){return _world;}
	bool IsGameOver(){return _isGameOver;}
	void Update(DWORD tickPerFrame,CDxInput* input);
	void LoadDataFromFile(char *filePath);
	void SaveDataToFile();
	void LoadNewWorld();
	void Reset();
	void FinshMap();
	void Draw();
	void CreateSighMap(int world);
};

#endif